package lab03.test13;
import java.sql.*;
public class Test13 {
    private static final String SQL2 = ;
    public static void main(String[] args) {
        Connection connection = null;
        Statement statement = null;
        ResultSet resultSet = null;
        String SQL1 = "insert into t_students(
        stu_no,real_name,age," +
        "gender,department) " +
                "select '95001','FG',20,1,'cs'
        UNION " +
        "select '95002','DF',20,1,'cs'
        UNION " +
        "select '95003','GF',20,1,'cs'
        UNION " +
        "select '95004','SAD',20,1,'cs'
        UNION " +
        "select '95005','DS',20,1,'cs'
        UNION " +
        "select '95006','FD',20,1,'cs'
        UNION " +
        "select '95007','FGF',20,1,'cs'
        UNION " +
        "select '95008','FSD',20,1,'cs'
        UNION "
        String SQL2 = "select * from t_students";
        String SQL2 = "delete from t_students
        where id=5";
        String SQL4 = "update t_students
        set department='信息与工程学院' where id=3";
        try {
            Class.forName("
                    com.mysql.cj.jdbc.Driver");
                    connection =
                            DriverManager.getConnection(
                                    "jdbc:mysql://localhost:3306/
                                    java_2017?serverTimezone=
                                            UTC&characterEncoding=utf-8",
                                    "root",
                                    "123456");
            statement = connection.createStatement();
            statement.execute(sql4);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                statement.close();
                connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

}
